## Writing to the Setup File (mks4agb.ini)

Using a text editor, the Sound Object parameter data are written into the mks4agb.ini file that was placed in the Working Directory. Please set these up as written in this color.
(In the mks4agb.ini file, text coming after a semicolon (;) to the end of the line is a comment.)
If you have proceeded through the set up as described in the tutorial, then all you need to do is set things up as described below, and you should have no problems. The "Explanation" links connect to descriptions of each of the parameters.
* Note: The use of double-byte characters will generate system errors upon execution, so please avoid double-byte characters. (This includes double-byte spaces.)
* A set up file is available that has all of the parameters already set up. If writing in the parameters is too much trouble, you can download the mks4agb.ini file at the bottom of the page and use it.

INDEX Writing the Set Up File (mks4agb.ini)

      (1) Rebuild Switch
      (2) Waveform Data Input Directory
      (3) Song Data Input Directory
      (4) Source File Directory
      (5) Output Directory
      (6) AGB System Library File Directory
      (7) GCC Execution Path
      (8) Initial Setup Values for Sound Modes
      (9) Starting Tone Color Group Setup
     (10) Tone Color Setup
     (11) Key Split Table Setup
     (12) Sound 3 Waveform Setup
     (13) Music Player Setup
     (14) Song Setup
     (15) MIDI Input Performance Setup
     (16) Memory Access Area Size
     (17) Maximum Lines for Processing Time of m4aSoundMain()
     (18) DMA Limit Switch
     (19) System ROM Use Switch

#### Rebuild Switch

Set to 0. (Explanation)

`rebuild = 0`

Return to Top

#### Waveform Data Input Directory

This specifies the directory for the Waveform Data File (Explanation)

`aif_dir = aiff\`

Return to Top

#### Song Data Input Directory

This specifies the directory for the Song Data File. (Explanation)

`mid_dir = midi\`

Return to Top

#### Source File Directory

This specifies the directory for Source Files that are output. (Explanation)

`src_dir = src\`

Return to Top

#### Output Directory

This specifies the directory for Sound Objects that are output. (Explanation)

`out_dir = out\`

Return to Top

#### AGB System Library File Directory

This specifies the directory for the library files installed with the Game Boy Advance Developer Toolkit 2.0. (Explanation)

`agb_lib = C:\agb\lib`

Return to Top

#### GCC Execution Path

This is the execution path for the GCC compiler. Please use the following two: (Explanation)

`cmd_path=C:\Program files\Cygnus\thumbelf-000512\H-i686-cygwin32\bin`
`cmd_path=C:\Program files\Cygnus\native-99r1\H-i686-cygwin32\bin`
* In the event that the compiler is upgraded, the execution path will also have to be changed.

Return to Top

#### Initial Setup Values for Sound Modes

Use the values specified in the defaults. They are:
- Simultaneously-Produced Direct Sounds: 8
- Direct Sound Master Volume: 13
- Playback Frequency of Direct Sounds: 21024
- Final Output DA Conversion Bit Count: 8
(Explanation)

`mode_i = 8, 13, 21024, 8`

Return to Top

#### Starting Tone Color Group Setup

In the tutorial demonstration, three Tone Color Groups are set up.
After declaring the Tone Color Group Start, the Tone Colors belonging to each of those groups are specified.
The correct way to write the settings is summarized in the Tone Color Setup Categories shown below. (Explanation)

`vgroup = 0
(The Tone Color settings for Tone Color Group 0 follow.)
vgroup = 1
(The Tone Color settings for Tone Color Group 1 follow.)
vgroup = 2
(The Tone Color settings for Tone Color Group 2 follow.)`

Return to Top

#### Tone Color Setup

This sets up the Tone Colors corresponding to the MIDI Program Change Numbers.
This sets up various elements for each sound such as color tone type (Direct Sound or Compatible Sound), ADSR, etc., and adds a "Color".
Many different types of Tone Color can be specified for even a single set of sampled waveform data by changing the parameters.
Many of the Tone Color Settings have been specified in the Tutorial Demonstration. Specify the settings as follows. The start definition for the Tone Color Groups is also included. (Explanation)

Return to Top

    vgroup = 0
    p000 = A, gun,        99,  99,  99,  99
    p001 = A, se3,        99,  99,  99,  99
    p002 = A, se5,        99,  99,  99,  99
    p003 = A, se8,        99,  99,  99,  99
    p004 = A, se9b,       99,  99,  99,  99
    p005 = A, flutec4,    99,  99,  99,  99
    p006 = Q, sc2dt12,    99,  99,  99,  99
    p007 = Q, sc1dt50,    99,  99,  99,  99,,,,1c
    p008 = Q, sc2dt50,    99,  99,  99,  99
    p009 = Q, sc1dt50,    99,  99,  99,  99,,,,1c
    p010 = Q, sc4st15,    99,  99,  99,  99
    p011 = A, suboscc3,   99,  99,  99,  99
    p012 = A, orgc3,      99,  99,  99,  99

    p016 = Q, sc2dt12,    99,  66,  00,  99

    p017 = A, synbsc2,    99,  99,  99,  80
    p018 = A, brassc3,    99,  99,  99,  80
    p019 = A, mutetpc4,   99,  99,  99,  80
    p020 = A, cutgtg3,    99,  99,  99,  99
    p021 = A, sawg3,      99,  99,  99,  99
    p022 = A, sinec3,     99,  99,  99,  99
    p023 = A, revcym,     99,  99,  99,  99
    p024 = S, 0, 2, c1
    p025 = S, 1, 2, c1
    p026 = A, engin01a,   99,  99,  99,  99
    p027 = Q, sc3w001,    99,  99,  99,  99

    p127 = R, 1, c1

    vgroup = 1
    p000 = F, housebd,    99,  99,  99,  99,  60    ;C1
    p001 = F, housesd,    99,  99,  99,  99,  60    ;C#1
    p002 = F, housechh,   99,  99,  99,  99,  60    ;D1
    p003 = F, houseohh,   99,  99,  99,  99,  60    ;D#1
    p004 = F, tamba,      99,  99,  99,  99,  60    ;E1
    p005 = F, vibra,      99,  99,  99,  99,  60    ;F1
    p006 = F, timbale,    99,  99,  99,  99,  60    ;F#1
    p007 = F, se8,        99,  99,  99,  99,  60    ;G1

    vgroup = 2
    p000 = A, harpc3,     99,  99,  99,  40
    p001 = A, harpc5,     99,  99,  99,  40

You may view the content of the parameters in the Sound Driver Manual by means of the "Explanation" link.

Return to Top

#### Key Split Table Setup

This registers the Key Split Table Numbers. In the Tutorial Demonstration, a number of Key Split Tone Colors are used. Set them up as shown below. (Explanation)

Return to Top

    ;       C1, C#1,D1. D#1,E1, F1, F#1,G1, G#1,A1,A#1, B1,
    t000 =  00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C1-B1

    ;       C2, C#2,D2. D#2,E2, F2, F#2,G2, G#2,A2,A#2, B2,
            00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C2-B2

    ;       C3, C#3,D3. D#3,E3, F3, F#3,G3, G#3,A3,A#3, B3,
            00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C3-B3

    ;       C4, C#4,D4. D#4,E4, F4, F#4,G4, G#4,A4,A#4, B4,
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01,  ;C4-B4

    ;       C5, C#5,D5. D#5,E5, F5, F#5,G5, G#5,A5,A#5, B5,
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01,  ;C5-B5

    ;       C6, C#6,D6. D#6,E6, F6, F#6,G6, G#6,A6,A#6, B6,
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01   ;C6-B6

    t001 =  00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C1-B1
            00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C2-B2
            00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,  ;C3-B3
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01,  ;C4-B4
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01,  ;C5-B5
            01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01, 01   ;C6-B6

Return to Top

#### Sound 3 Waveform Setup

This sets up the Sound 3 Waveforms. A number of Tone Colors that use Sound 3 are used in the Tutorial Demonstration. Set them up as shown below. (Explanation)

          w000 = 0011235689ACDEEFFFEEDCA986532110, sinewave
          w001 = 0123456789ABCDEFFEDCBA9876543210, triangle
          w002 = FFEEDDCCBBAA99887766554433221100, fat_saw
          w003 = FEDCBA99888888887777777766543210, thin_saw
          w004 = FFFF0000000000000000000000000000, square12
          w005 = FFFFFFFF000000000000000000000000, square25
          w006 = FFFFFFFFFFFF00000000000000000000, square37
          w007 = FFFFFFFFFFFFFFFF0000000000000000, square50

Return to Top

#### Music Player Setup

This specifies the Music Player used during a game and the number of tracks that can be played back. Four Music Players are used in this Tutorial Demonstration. Set them up as shown below. (Explanation)

        mp00 = 8

        mp01 = 6

        mp02 = 2

        mp03 = 2

Return to Top

#### Song Setup

This sets up the Song Data. The numbers specified here are used when starting songs or sound effects by number. By setting each parameter, it is possible to specify priority, etc. Many songs are used in the Tutorial Demonstration. Set them up as shown below. (Explanation)

    s001 = se_d01,    3, 0, 127, 10     ; Direct Single Event
    s002 = se_dbend,  3, 0, 127, 10     ; Direct + Pitch Bend + Single Event
    s003 = se_dvib,   3, 0,  60, 10     ; Direct + Vibrato + Single Event
    s004 = se_gbend2, 3, 0,  90, 10     ; Compatible + Pitch Bend + Single Event
    s005 = se_swep2,  3, 0,  90, 10     ; Compatible + Sweep + Single Event
    s006 = se_noise,  3, 0, 127, 10     ; Compatible + Noise + Single Event
    s007 = sound3,    3, 0, 127, 10     ; Compatible Sound 3

    s008 = se_dben2,  3, 0, 127, 10     ; Direct + Pitch Bend + Continuous
    s009 = se_gbend,  3, 0,  90, 10     ; Compatible + Pitch Bend + Continuous
    s010 = se_sweep,  3, 0, 127, 10     ; Compatible + Sweep + Continuous
    s011 = se_dgmix,  3, 0, 127, 10     ; Direct + Compatible (Mixed)
    s013 = agb2000,   2, 0, 127, 20, 50 ; AGB 2000!!
    s014 = wario,     0, 0, 100,  0, 50 ;
    s015 = engin,     3, 0, 127, 10     ; Engine Sound (Loop)

You may view the content of the parameters in the Sound Driver Manual by means of the "Explanation" link.

Return to Top

#### MIDI Input Performance Setup

Use the values specified in the defaults. They are:
- MIDI Input Performance Switch 0
- MIDI Performance Tone Color Group 0
- MIDI Performance Master Volume 120
- MIDI Performance Priority 200
- MIDI Performance Tempo (Affects LFO Speed) 120
(Explanation)

      pbymidi = 0, 0, 120, 200, 120

Return to Top

#### Memory Access Area Size

Use the value set up as the default. (Explanation)

      memacc_s = 16

Return to Top

#### Maximum Lines for Processing Time of m4aSoundMain()

You can set a limit for the processing time in the sound main routine.
Specify no limit here, "0". (Explanation)

      max_line = 0

Return to Top

#### DMA Limit Switch

Use the value specified in defaults. (Explanation)

      only_dma1 = 0

Return to Top

#### System ROM Use Switch

Use the value set as the default. (Explanation)

      sys_rom = 0

Return to Top

The mks4agb.ini is the setup file that is required for sound creation in this system.
When actually using the system, please be sure to read the Details which are linked to each of the categories (Explanation).
A mks4agb.ini file with the above settings can be downloaded below.
* Download a Sample Setup File (IniFile.zip 4KB)

This concludes the settings for the mks4agb.ini file. Please proceed to the next section. Next: Running mks4agb.exe

[ | Back | User's Manual Table of Contents | Tutorial Table of Contents | Next | ]